function jsonp (options){
    //动态创建script标签
    var script = document.createElement('script');
    var str = '';
    for(var attr in options.data){
        str+='&'+attr+'='+options.data[attr];
    }
    var fnName = 'myjsonp' + Math.random().toString().replace('.','');
    //先把这个变成全局函数
    //widow下的属性下面
    window[fnName] = options.success;
    //为script标签添加src属性
     script.src = options.url+'?callback='+fnName+str;
    document.body.appendChild(script);
    //为script标签价onload;
    script.onload = function(){
    document.body.removeChild(script);
    }
}


